package com.xlh.dao.courseTest;

import com.xlh.dto.courseTest.QuestionListDTO;
import com.xlh.pojo.courseTest.CourseQuestionRepository;
import com.xlh.pojo.courseTest.CourseQuestionRepositoryExample;
import com.xlh.pojo.courseTest.CourseTestPaperQuestion;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zhr 2019/2/13
 */
@Repository
public interface CourseQuestionRepositoryMapperExt {
    List<QuestionListDTO> questionList(
            @Param("keyWord") String keyWord, @Param("courseId") Long courseId, @Param("chapterId") Long chapterId,
            @Param("questionType") Integer questionType, @Param("businessType") Integer businessType,
            @Param("userId") Long userId, @Param("isPreset") Boolean isPreset);
    List<QuestionListDTO> questionListOther(
            @Param("keyWord") String keyWord, @Param("courseId") Long courseId, @Param("chapterId") Long chapterId,
            @Param("questionType") Integer questionType, @Param("businessType") Integer businessType,
            @Param("userId") Long userId, @Param("isPreset") Boolean isPreset);

    Long selectMaxId();

    void insertBatch(List<CourseQuestionRepository> questionList);

    List<CourseTestPaperQuestion> selectPaperQuestionByExample(CourseQuestionRepositoryExample example);

    List<QuestionListDTO> questionListByIds(@Param("ids") List<Long> ids);

    /**
     * 条件查询并过滤章节falg=0的题目
     * @param example
     * @return
     */
    List<CourseQuestionRepository> selectByExample(CourseQuestionRepositoryExample example);
}
